package Jdk新特性.Lambda表达式;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class Test01 {


    public static void main(String[] args) {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                System.out.println("hello");
//            }
//        }).start();

        new Thread(() -> System.out.println("hello")).start();


        List<Person> list = new ArrayList<>();
        list.add(new Person("张三", 4));
        list.add(new Person("李四", 5));
        list.add(new Person("王五", 6));

        Collections.sort(list, (o1, o2) -> o1.getAge() - o2.getAge());
        System.out.println(list);
    }
}
